﻿#region

using System.ComponentModel.DataAnnotations;

#endregion

namespace HouseHoldBudget.Models.Budgets
{
    public class CategoryExpenseModel
    {
        #region Instance Properties

        /// <summary>
        /// Gets or sets the category expense.
        /// </summary>
        /// <value>
        /// The category expense.
        /// </value>
        [DataType(DataType.Currency)]
        public decimal CategoryExpenseAppointedAmount { get; set; }

        /// <summary>
        /// Gets or sets the category expense amount.
        /// </summary>
        /// <value>
        /// The category expense amount.
        /// </value>
        [DataType(DataType.Currency)]
        public decimal CategoryExpenseAmount { get; set; }

        /// <summary>
        /// Gets or sets the category expense stay amount.
        /// </summary>
        /// <value>
        /// The category expense stay amount.
        /// </value>
        [DataType(DataType.Currency)]
        public decimal CategoryExpenseStayAmount
        {
            get
            {
                decimal remains = CategoryExpenseAppointedAmount - CategoryExpenseAmount;
                if(remains>0)
                {
                    return remains;
                }
                return 0;
            }
        }

        /// <summary>
        /// Gets or sets the name of the category.
        /// </summary>
        /// <value>
        /// The name of the category.
        /// </value>
        public string CategoryName { get; set; }

        #endregion
    }
}